using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ForGVN
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataTable dtb = null;
                dtb = Class2.ClaimSP1(dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString());
                if (dtb != null)
                {
                    dataGridView1.DataSource = dtb;

                    dataGridView1.SelectAll();
                    dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
                    Clipboard.SetDataObject(dataGridView1.GetClipboardContent());

                    MessageBox.Show("Data has been copied to clipboard", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Error", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DataTable dtb = null;
            dtb = Class2.ClaimSP2(dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString());
            if (dtb != null)
            {
                dataGridView1.DataSource = dtb;

                dataGridView1.SelectAll();
                dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
                Clipboard.SetDataObject(dataGridView1.GetClipboardContent());

                MessageBox.Show("Data has been copied to clipboard", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Error", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            DataTable dtb = null;
            dtb = Class2.ClaimSP3(dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString());
            if (dtb != null)
            {
                dataGridView1.DataSource = dtb;

                dataGridView1.SelectAll();
                dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
                Clipboard.SetDataObject(dataGridView1.GetClipboardContent());

                MessageBox.Show("Data has been copied to clipboard", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Error", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }


    }
}